package com.ly;

/**
 * @author LY
 * @date 2021年07月10日 13:24
 * @project test
 */
public class StringBuilderTest {
    public static void main(String[] args) throws InterruptedException {
        StringBuffer stringBuilder = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int j = 0; j < 1000; j++) {
                        stringBuilder.append("a");

                    }
                }
            }).start();
        }

        Thread.sleep(100);
        System.out.println(stringBuilder.length());
    }
}

